<div class="btn-group">
    <a class='btn btn-primary'> <i class="fa"></i> <?php echo $title; ?>-评论管理 </a>
</div>

<?php include_once 'inc_modules_path.php'; ?>
<?php //include_once 'inc_ctype_index.php'; ?>

<div class="clearfix"><p></p></div>

<div class="boxed">
	<div class="boxed-inner seamless">

<table class="table table-striped table-hover select-list">
	<thead>
		<tr>
			<th class="width-small"><input id='selectbox-all' type="checkbox" > </th>
			<th>评论人姓名</th>
			<th>评论内容</th>
            <?php if($_GET['pid']==0){?>
			<th>二级评论</th>
            <?php }?>
			<th>评论时间</th>
			<th class="span1">操作</th>
		</tr>
	</thead>
	<tbody class="sort-list">
		<?php foreach ($list as $v):?>
		<tr data-id="<?php echo $v['id'] ?>">
			<td><input class="select-it" type="checkbox" value="<?php echo $v['id']; ?>" ></td>
            <td><?php echo $v['uname'] ?></td>
            <td> <?php echo $v['content']; ?> </td>
            <?php if($_GET['pid']==0){?>
            <td>
                <a href="<?php echo site_url('comments/index?c='.$this->cid).'&rid='.$v['rid'].'&type='.$v['type'].'&pid='.$v['id'] ?>">查看</a>
            </td>
            <?php }?>
            <td> <?php echo date("Y/m/d H:i:s",$v['created']); ?> </td>
			<td>
				<div class="btn-group">
                    <?php //TODO:检测权限 ?>
                    <?php if ($v['audit']): ?>
                        <a href="#"  title="禁用"  class='btn btn-primary btn-small btn-ajax-audit' data-id="<?php echo $v['id'] ?>" data-audit="0">  <i class="fa fa-thumbs-up"></i> </a>
                    <?php else: ?>
                        <a href="#" title="启用" class='btn btn-small btn-ajax-audit' data-id="<?php echo $v['id'] ?>" data-audit="1"> <i class="fa fa-thumbs-down"></i> </a>
                    <?php endif ?>
				</div>
			</td>
		</tr>
		<?php endforeach;?>
	</tbody>
</table>
	</div>
</div>

<div class="btn-group">
	<a id='select-all' class='btn' href="#"> <i class=""></i> <?php echo lang('select_all') ?> </a>
    <a id="btn-audit" class='btn' href="#" data-audit='1'>启用</a>
    <a id="btn-audit" class='btn' href="#"  data-audit='0'>禁用</a>
</div>

<?php echo $pages; ?>

<script>
require(['adminer/js/ui'],function(ui){
	var comments = {
		url_audit: "<?php echo site_urlc('comments/audit'); ?>"
	};
	ui.btn_audit(comments.url_audit);	// 审核
});
</script>






